/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package horizon.map;

import horizon.graphics.RenderingContext;
import horizon.util.Vector2;

public class Chunk {
    
    
    public Vector2 worldPosition;
    
    
    public Tile[] tiles = new Tile[Map.tileSide * Map.tileSide];
    
    public Chunk(Vector2 pos){
        
        worldPosition = pos;
        
    }
    
    public Chunk(Tile[] tiles , Vector2 pos){
        
        worldPosition = pos;
        
        if(tiles.length == Map.tileSide * Map.tileSide){
            
            this.tiles = tiles;
            
        }
        else{
            System.out.println("ERR: WRONG CHUNK SIZE");
        }
        
    }
    
    public void render(RenderingContext r){
        
        for(int i = 0 ; i < 10 ; i++){
            
            for(int n = 0 ; n < 10 ; n++){
                
                tiles[(i * 10) + n].render(r);
                 
            }
            
        }
        
    }
    
}
